package com.newtouch.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.newtouch.common.Page;
import com.newtouch.dao.FASRoleDao;
import com.newtouch.model.FASRole;
import com.newtouch.service.FASRoleService;
import com.newtouch.service.base.impl.BaseServiceImpl;
@Service
public class FASRoleServiceImpl extends BaseServiceImpl implements
		FASRoleService {
	@Autowired
	private FASRoleDao fasroledao;


	public void addFASRole(FASRole fasrole) {
		fasroledao.insertModelObject(fasrole);
	}

	public Integer deleteFASRole(String id) {
		return fasroledao.deleteModelObject(new Long(id));
	}

	public Integer editFASRole(FASRole fasrole) {
		return fasroledao.updateModelObject(fasrole);
	}

	public FASRole findFASRoleById(String id) {
		return fasroledao.getModelObject(new Long(id));
	}

	public List<FASRole> findFASRoles(Page page) {
		return fasroledao.selectModelObjectListPage(page);
	}


	public List<FASRole> findAllFASRole() {
		return fasroledao.findAllModelObjectList();
	}


	public List<FASRole> findFASRolesByUserName(String userName) {
		Map<String, String> paraMap=new HashMap<String, String>();
		paraMap.put("userName", userName);
		return fasroledao.selectModelObjectListWithSQLID("FASRole.selectByUserName", paraMap);
	}
}